package com.kaifamiao.www.ioDemo.do0923;

public class ClassDemo {

    public static void main(String[] args) {

        /**
         * 获取Class对象
         * 1，调用对象的getClass()方法
         * 2，调用类的class属性
         * 3，使用Class类的forName()方法
         */
        Student stu = new Student();
        Class cls = stu.getClass();
        System.out.println(cls);
        Class cla = Student.class;
        System.out.println(cla);
        try {
            Class clas = java.lang.Class.forName("com.kaifamiao.www.ioDemo.do0923.Student");
            System.out.println(clas);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }


    }
}
